from django.conf.urls.defaults import *
import views

################################################################################
urlpatterns = patterns('casestudies',
    url(r'^$', views.home, name="home"),
    url(r'^welcome$', views.welcome, name="welcome"),
    url(r'^user/(?P<id>[\w-]+)/$',
        views.user,
        name="user"),
    url(r'^login/(?P<key>\w+)/$',
        views.do_login,
        name="login"),
    url(r'^logout/$',
        views.logout_view,
        name="logout"),
    url(r'^activate/(?P<key>\w+)/$',
        views.activate_user,
        name="activate"),
    url(r'^constituency/(?P<slug>[\w-]+)/$',
        views.constituency,
        name="constituency"),
    url(r'^constituency/(?P<slug>[\w-]+)/(?P<year>\d+)/$',
        views.constituency,
        name="constituency-by-year"),
    url(r'^add_constituency/$',
        views.add_constituency,
        name="add_constituency"),
    url(r'^delete_constituency/(?P<slug>[\w-]+)/$',
        views.delete_constituency,
        name="delete_constituency"),
    url(r'^statistics/fewerthan/(?P<volunteers>\d+)/geo.rss$',
        views.constituencies_with_fewer_than_rss,
        name="constituencies_with_fewer_than_rss"),
    url(r'^statistics/morethan/(?P<volunteers>\d+)/geo.rss$',
        views.constituencies_with_more_than_rss,
        name="constituencies_with_more_than_rss"),
    url(r'^statistics/$',
        views.statistics,
        name="statistics"),
    url(r'^statistics/heatmap.svg$',
        views.generate_map,
        name="map"),
                      
)

